﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Tailoring
{
    public partial class Searchpopup : Form
    {
        
        public Searchpopup()
        {
            InitializeComponent();
        }
        public string psearch { get { return txtsearhkey.Text; } }
        public void loadclient()
        { 
        
        
        
        
        
        }
        private void Searchpopup_Load(object sender, EventArgs e)
        {

        }

        private void txtsearhkey_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (Convert.ToInt32(e.KeyChar) == 13)
            {
                if (txtsearhkey.Text.Length > 0)
                {
                    frmviewpemaish vp = new frmviewpemaish();
                    vp.psearchkey = psearch;
                    
                    vp.MdiParent = this.ParentForm;
                    vp.Show();
                    string str = "SELECT     dbo.tblclientinfo.*, dbo.tblpemaish.* FROM dbo.tblpemaish INNER JOIN dbo.tblclientinfo ON dbo.tblpemaish.clientId = dbo.tblclientinfo.clientId WHERE(dbo.tblclientinfo.clientId) =@Key";
                    
                    vp.loadclient(txtsearhkey.Text,str);
                    this.Close();
                    
                    
                }
                else
                {
                    this.Close(); 
                }
                
            
            
            }
            
        }

        private void txtsearhkey_TextChanged(object sender, EventArgs e)
        {

        }

    }
}
